<template>
    <div class="top_panel">
        <h1>{{ topText }}， 欢迎{{userName}}登录！{{ nowTime }}</h1>
    </div>
</template>

<script>
export default {
  name: 'Top',
  props: ['userName', 'nowTime'],
  data () {
    return {
      topText: '我是头部'
    }
  },
  created () {
    this.$emit('login', '登录成功')
  }
}
</script>

<style scoped>
h1, h2 {
  font-weight: normal;
}
.top_panel {
    background-color: darkgray;
    padding: 1px 0;
}
</style>
